package com.xuecheng.manage_course.controller;

import com.xuecheng.api.course.CoursePublishControllerApi;
import com.xuecheng.framework.domain.course.response.CoursePublishResult;
import com.xuecheng.manage_course.service.CoursePublishService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/course")
@RestController
public class CoursePublishController implements CoursePublishControllerApi {
    @Resource
    CoursePublishService coursePublishService;
    /**
     * 课程发布接口,是远程调用的cms服务中的页面发布接口
     *
     * @param courseid 课程id
     * @return 发布响应结果
     */
    @Override
    @PostMapping("/publish/{courseid}")
    public CoursePublishResult publish(@PathVariable("courseid") String courseid) {
        return coursePublishService.publish(courseid);
    }
}
